Optimal. Leaf size=169 \[ \frac {(7 A-4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A-B+C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos (c+d x)}{2 d \sqrt {a \sec (c+d x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.40, antiderivative size = 169, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.140, Rules used = {4086, 4022, 3920, 3774, 203, 3795} \[ \frac {(7 A-4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A-B+C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos (c+d x)}{2 d \sqrt {a \sec (c+d x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 3774
Rule 3795
Rule 3920
Rule 4022
Rule 4086
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx &=\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\cos (c+d x) \left (-\frac {1}{2} a (A-4 B)+\frac {1}{2} a (3 A+4 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{2 a}\\ &=-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\frac {1}{4} a^2 (7 A-4 B+8 C)-\frac {1}{4} a^2 (A-4 B) \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{2 a^2}\\ &=-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+(-A+B-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx+\frac {(7 A-4 B+8 C) \int \sqrt {a+a \sec (c+d x)} \, dx}{8 a}\\ &=-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {(2 (A-B+C)) \operatorname {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}-\frac {(7 A-4 B+8 C) \operatorname {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d}\\ &=\frac {(7 A-4 B+8 C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A-B+C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {(A-4 B) \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 27.59, size = 16835, normalized size = 99.62 \[ \text {Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 15.71, size = 521, normalized size = 3.08 \[ \left [\frac {4 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right ) + {\left (A - B + C\right )} a\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - {\left ({\left (7 \, A - 4 \, B + 8 \, C\right )} \cos \left (d x + c\right ) + 7 \, A - 4 \, B + 8 \, C\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (2 \, A \cos \left (d x + c\right )^{2} - {\left (A - 4 \, B\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{8 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, -\frac {{\left ({\left (7 \, A - 4 \, B + 8 \, C\right )} \cos \left (d x + c\right ) + 7 \, A - 4 \, B + 8 \, C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (2 \, A \cos \left (d x + c\right )^{2} - {\left (A - 4 \, B\right )} \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) - \frac {4 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right ) + {\left (A - B + C\right )} a\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{4 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 2.71, size = 656, normalized size = 3.88 \[ -\frac {\frac {4 \, \sqrt {2} {\left (A - B + C\right )} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} + \frac {{\left (7 \, A - 4 \, B + 8 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} - \frac {{\left (7 \, A - 4 \, B + 8 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} + \frac {4 \, \sqrt {2} {\left (17 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} A \sqrt {-a} - 12 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} B \sqrt {-a} - 57 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} A \sqrt {-a} a + 76 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} B \sqrt {-a} a + 19 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} A \sqrt {-a} a^{2} - 36 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} B \sqrt {-a} a^{2} - 3 \, A \sqrt {-a} a^{3} + 4 \, B \sqrt {-a} a^{3}\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{2} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.82, size = 1025, normalized size = 6.07 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \cos \left (d x + c\right )^{2}}{\sqrt {a \sec \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\cos \left (c+d\,x\right )}^2\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________